const hre = require("hardhat");

async function main() {
  const contractAddress = "0xb16c4FD708b88220e02fC54cBF5291A70Ad4a5Ee";
  
  console.log("Contract address:", contractAddress);
  
  try {
    // 检查合约的BNB余额
    const balance = await hre.ethers.provider.getBalance(contractAddress);
    console.log("Contract BNB balance:", hre.ethers.formatEther(balance), "BNB");
    
    // 检查launch 1的信息
    const BSCLaunchPad = await hre.ethers.getContractFactory("BSCLaunchPad");
    const contract = BSCLaunchPad.attach(contractAddress);
    
    const launch = await contract.tokenLaunches(1);
    console.log("Launch 1 info:", {
      tokenAddress: launch.tokenAddress,
      raisedAmount: hre.ethers.formatEther(launch.raisedAmount),
      tokensSold: hre.ethers.formatEther(launch.tokensSold),
      launched: launch.launched,
      cancelled: launch.cancelled
    });
    
  } catch (error) {
    console.error("Error:", error.message);
  }
}

main()
  .then(() => process.exit(0))
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });
